package com.tjj.demo.springboot.es.repository;

import com.tjj.demo.springboot.es.entity.Blog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface BlogJPARepository extends JpaRepository<Blog, Integer> {
    @Query("select o from Blog o where o.title like %:keyword% or o.content like %:keyword%")
    List<Blog> searchByMysql(@Param("keyword") String keyword);
}
